package cn.adelyn.base.rbac.test;

import cn.adelyn.base.api.rbac.pojo.bo.CheckPermissionBO;
import cn.adelyn.base.rbac.RbacApplication;
import cn.adelyn.base.rbac.feign.PermissionFeignController;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest(classes = RbacApplication.class)
@Slf4j
public class RbacTester {

    @Autowired
    PermissionFeignController permissionController;

    @Test
    public void checkPermission() {
        CheckPermissionBO checkPermissionBO = new CheckPermissionBO();
        checkPermissionBO.setUserType(0);
        checkPermissionBO.setUri("/blog/auth/userauss");
        checkPermissionBO.setMethod(2);

        log.info(permissionController.checkPermission(checkPermissionBO).toString());
    }
}
